﻿using System;
using WiMo.Games.Drawables;

namespace WiMo.Games.Premium.GDIDisplay.Drawables
{
    public class Polygon : SpriteShapeBase
    {
        /// <summary>
        /// Initializes a new instance of the Polygon class.
        /// </summary>
        public Polygon()
        {
            ShapeType = ShapeType.Polygon;
            Origin = Origin.TopLeft;
        }

        public override void Render(IDisplay display)
        {
            var displayManager = display as DisplayManager;
            var position = displayManager.GetAdjustedPosition(this);

            displayManager.Graphics.FillPolygon(FillColor, DisplayManager.GetPointArray(Points, position));
            displayManager.Graphics.DrawLines(BorderColor, BorderWidth, DisplayManager.GetPointArray(Points, position));
        }

        public override void Dispose()
        {
            
        }
    }
}
